﻿using GolSig.Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Test.GolSig.Library.GridSizeSpecs
{
    
    
  
    [TestClass()]
    public class WhenCreatingGridSize
    {


    

       
        [TestMethod(), ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void giveInvalidRow_shouldRaiseException()
        {
            int rows = 0; 
            int columns = 1; 
            GridSize target = new GridSize(rows, columns);
            Assert.Fail("Expected exception");
        }


        [TestMethod(), ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void giveInvalidColumn_shouldRaiseException()
        {
            int rows = 1;
            int columns = 0;
            GridSize target = new GridSize(rows, columns);
            Assert.Fail("Expected exception");
        }


        [TestMethod()]
        public void giveValidInput_ExtraRowAndColumShouldBeAdded()
        {
            int rows = 1;
            int columns = 1;
            GridSize target = new GridSize(rows, columns);
            Assert.IsTrue(target.Rows == rows + 2);
            Assert.IsTrue(target.Columns== columns + 2);

        }
    }
}
